import { getBannerAPI } from '@/apis/home';
import { onMounted, ref } from "vue";
import {  useRoute } from "vue-router";




export function useBanner() {
    const route = useRoute()
    //获取数据(轮播图)
    const BannerList = ref([])
    const getBanner = async () => {
        const res = await getBannerAPI(route.params.id)
        BannerList.value = res.data;
    }
    onMounted(() => getBanner())
    return {
        BannerList
    }
}